package com.leeon.container.set;

import java.util.Collections;
import java.util.HashSet;
import java.util.Set;

import static net.mindview.util.Print.print;

public class SetOperations {

    public static void main(String[] args){
        Set<String> set1 = new HashSet<String>();
        Collections.addAll(set1,"a b c d e f g h i j k l".split(" "));
        set1.add("m");
        print("H : " + set1.contains("h"));
        print("N : " + set1.contains("n"));
        Set<String> set2 = new HashSet<String>();
        Collections.addAll(set2,"h i j k l".split(" "));
        set1.remove("h");
        print("set1: " + set1);
        print("set2 in set1 " + set1.containsAll(set2));
        set1.removeAll(set2);
        print("set2 remove from set1 " + set1);
        Collections.addAll(set1,"x y z".split(" "));
        print("'x y z ' added to set1: " + set1);
    }

}
